@echo off

call :job configure

call :job list

goto build%errorlevel%

:build0
if "%firmware%"=="" (
	goto build_all
) else (
	goto build_firmware
)
goto build_none

:build_firmware
call :job clean
call :job build %firmware% %ver%
goto build_none

:build_all
call :job clean all
for %%a in (%SymDir%\*.sym) do (
	call :job clean
	call :job build %%~na %ver%
)
call :job clean bin
call :job archive
goto build_none

:build1
:build_none
exit

:job
call zconfig.bat %1 %2 %3
exit /b %errorlevel%